$(function(){
    loginName=baseFunction.getUrlParameterValueByKey("loginName");
    // merchno=baseFunction.getUrlParameterValueByKey("merchno");

    getList();
    //提现
    $(".list").on("click",".li",function(){
        var status=$(this).attr("data_status"); //通道状态
        var id=$(this).attr("data_id"); //id
        if(status==2){
            $(".mask .tip").html("通道维护中");
            $(".mask").show();
            return;
        }
        window.location.href="index_takeCash.html?loginName="+loginName+"&id="+id+"";
    })
})
/**
 * 获取列表数据
 */
function getList(){
    $(".loding").show();
    var data={
        userName: baseFunction.encryption(loginName),
        queryType:"6021",
        arg1: baseFunction.encryption("4"),
    };
    baseFunction.netRequest("param",data,function(res){
        
        var dataList=JSON.parse(JSON.parse(res.data).result);
        console.log(dataList);
        var html="";
        dataList.forEach(function(key){
            var imgSrc=key.status==1?"../static/img/haikuan_icon_open@2x.png":"../static/img/haikuan_icon_close@2x.png";
            html+="<div class='li' data_status='"+key.status+"' data_id='"+key.id+"' >"
                +"<img class='left' src='"+imgSrc+"'>"
                +"<div class='center'>"
                +"<div>"+key.ruleName+"</div>"
                +"<div>最小额度：<text>"+key.minAmount+"</text>元</div>"
                +"<div>最大交易额度：<text>"+key.maxAmount+"</text>元</div>"
                +"<div>交易时间段：<text>"+key.startTime+"</text>~<text>"+key.endTime+"</text></div>"
                +"</div>"
                +"<img class='right fr' src='../static/img/hhaikuan_button_right@2x.png'>"
                +"</div>";
        });
        $(".loding").hide();
        $(".list").html(html);
    })
}